package com.gpframework.module.order.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gpframework.common.core.domain.AjaxResult;
import com.gpframework.common.core.domain.entity.SysUser;
import com.gpframework.module.order.domain.GpOrderFlow;
import com.gpframework.module.order.domain.req.GpOrderFlowUpdate;
import com.gpframework.module.order.domain.vo.EfficiencyVo;
import com.gpframework.module.order.domain.vo.FormsVo;
import com.gpframework.module.order.domain.vo.GpOrderFlowVo;
import com.gpframework.module.order.domain.vo.OrderQuantityVo;

import java.util.List;
/**
 * @ClassName GpOrderFlow
 * @Author gpframework
 * @Date 2023-06-16
 * @Version 1.0.0
 * @Description 员工订单流转详情Service接口
 */
public interface IGpOrderFlowService extends IService<GpOrderFlow> {

    /**
     * @Description 查询列表返回VO 用于返回给前端的列表接口
     * @Author gpframework
     * @Date 2023-06-16
     * @Param [lqw]
     * @Return List<GpOrderFlowVo>
     */
    List<GpOrderFlowVo> listVo(QueryWrapper<GpOrderFlow> lqw);

    /**
     * @Description 通过查询详情VO 用于返回给前端的列详情接口
     * @Author gpframework
     * @Date 2023-06-16
     * @Param [id]
     * @Return GpOrderFlowVo
     */
    GpOrderFlowVo getVoById(Long id);

    String confirm(GpOrderFlowUpdate gpOrderFlowUpdate);

    String withdraw(GpOrderFlowUpdate gpOrderFlowUpdate);

    String transfer(GpOrderFlowUpdate gpOrderFlowUpdate);

    List<FormsVo> forms(String userId, String deptId, String type, String organiseUnit, String startTime, String endTime);

    AjaxResult add(GpOrderFlowUpdate gpOrderFlowUpdate);

    List<EfficiencyVo> efficiency(String deptId, String startTime, String endTime);

    List<OrderQuantityVo> orderQuantityStatistics(String deptId, List<SysUser> sysUsers, String orderStatus, String startTime, String endTime);

    List<SysUser> selectUserList(String deptId, String orderStatus, String startTime, String endTime);

    /**
     * 获取流程状态（细码、物流单、自提）
     * @param lqw
     * @return
     */
    String getFlowStatus(QueryWrapper<GpOrderFlow> lqw);

    String getFlowStatusHistory(QueryWrapper<GpOrderFlow> lqw);

    String getAnnexList(QueryWrapper<GpOrderFlow> lqw);

    /**
     * 获取订单所有流程的总时长
     * @param orderId
     * @return
     */
    Long getTotalDuration(Long orderId);


}
